package  test;
 
import java.io.File;

import jxl.Cell;
import jxl.CellType;
import jxl.LabelCell;
import jxl.NumberCell;
import jxl.Sheet;
import jxl.Workbook;
 
public   class  ReadExcel  {
     public   static   void  main(String args[])  {
         try   {
            Workbook book  =  Workbook.getWorkbook( new  File( "H:\\test.xls" ));
            Sheet sheet =  book.getSheet(0);
            Cell[] cells  =  sheet.getRow(0);
            for(Cell cell:cells){
//            	String result  =  cell.getContents();
//            	System.out.println(result);
            	if(cell.getType()==CellType.NUMBER){
            		NumberCell lab =(NumberCell) cell;
            		double dou = lab.getValue();
            		System.out.println("double:  "+dou);
            	}else if(cell.getType()==CellType.LABEL){
            		LabelCell lc =(LabelCell)cell;
            		String str = lc.getString();
            		System.out.println("string:  "+str);
            	}
            }
            book.close();
        }   catch  (Exception e)  {
            System.out.println(e);
        }
    }
}